namespace Rsdn.Framework.Formatting.JetBrains.Annotations
{
    using System;

    /// <summary>
    /// Indicates the condition parameter of the assertion method. 
    /// The method itself should be marked by <see cref="T:Rsdn.Framework.Formatting.JetBrains.Annotations.AssertionMethodAttribute" /> attribute.
    /// The mandatory argument of the attribute is the assertion type.
    /// </summary>
    /// <seealso cref="T:Rsdn.Framework.Formatting.JetBrains.Annotations.AssertionConditionType" />
    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple=false, Inherited=true)]
    internal sealed class AssertionConditionAttribute : Attribute
    {
        private readonly AssertionConditionType _conditionType;

        /// <summary>
        /// Initializes new instance of AssertionConditionAttribute
        /// </summary>
        /// <param name="conditionType">Specifies condition type</param>
        public AssertionConditionAttribute(AssertionConditionType conditionType)
        {
            this._conditionType = conditionType;
        }

        /// <summary>
        /// Gets condition type
        /// </summary>
        public AssertionConditionType ConditionType
        {
            get
            {
                return this._conditionType;
            }
        }
    }
}

